<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <!-- 准备好一个容器-->
  <div id="app">
    <h2>student姓名：{{studentName}}</h2>
    <h2>student年龄：{{studentAge}}</h2>
    <button @click="showStudentInof()">显示student信息</button>

    <h2>student姓名：{{studentName}}</h2>
    <h2>student年龄：{{studentAge}}</h2>
    <button @click="showStudentInof()">显示student信息</button>

    <h2>班级姓名：{{banjiName}}</h2>
    <h2>班级人数：{{banjiCount}}</h2>
    <button @click="showBanjiInof()">显示班级信息</button>

  </div>
  <script src="vue.js"></script>
  <script>
    Vue.config.productionTip = false //阻止 vue 在启动时生成生产提示。
    //创建vue实例
    new Vue({
      el: '#app',
      data: {
        studentName: 'zhangsan',
        studentAge: 23,
        banjiName: 'Java230301',
        banjiCount: 49
      },
      methods: {
        showStudentInof() {
          alert(this.studentName + " : " + this.studentAge);
        },
        showBanjiInof() {
          alert(this.banjiName + " : " + this.banjiCount);
        }
      },
    })
  </script>
</body>

</html>